package com.wiegand.gui.button.views {
	import com.wiegand.gui.text.CssTextSprite;
	import com.wiegand.util.RoundRectangle;

	import flash.display.MovieClip;
	import flash.display.Sprite;

	/**
	 * @author kwiegand
	 */
	public class ButtonViewSimple extends AbstractButtonView {
		
		private var _hSpace : int = 18;
		private var _vSpace : int = 0;
				
		override public function getUpState( xml : XMLList ) : MovieClip {
						
			var s : MovieClip = new MovieClip;
			
			var text : String = xml;
			var style : String = xml.attribute( "style" );
			
			var r : Sprite = RoundRectangle.create( 0x663e07, 12, 1, 100, 20 );
			s.addChild( r );
			
			var t : Sprite = CssTextSprite.create( text, style );
			t.x = _hSpace;
			s.addChild( t );
				
			r.width = t.width + 2 * _hSpace;
			r.height = t.height + 2 * _vSpace;	
								
			return s;
			
		}
		
		override public function getOverState(  xml : XMLList  ) : MovieClip {
						
			var s : MovieClip = new MovieClip;
	
			var text : String = xml;
			var style : String = xml.attribute( "style" );
			
			var r : Sprite = RoundRectangle.create( 0xd07004, 12, 1, 100, 20 );
			s.addChild( r );
			
			var t : Sprite = CssTextSprite.create( text, style );
			t.x = _hSpace;
			s.addChild( t );
					
			r.width = t.width + 2 * _hSpace;
			r.height = t.height + 2 * _vSpace;		
									
			return s;			
			
		}
		
		override public function getDownState(  xml : XMLList  ) : MovieClip {
						
			var s : MovieClip = new MovieClip;
			
			var text : String = xml;
			var style : String = xml.attribute( "style" );
			
			var r : Sprite = RoundRectangle.create( 0x663e07, 12, 1, 100, 20 );
			s.addChild( r );
			
			var t : Sprite = CssTextSprite.create( text, style );
			t.x = _hSpace;
			s.addChild( t );
			
			r.width = t.width + 2 * _hSpace;
			r.height = t.height + 2 * _vSpace;
						
			return s;			
			
		}
		
	}
}
